#ifndef MONITOR_H
#define MONITOR_H

#include <QWidget>
#include <QtWidgets>
#include "mqtthandler.h"
#include <QDialog>
#include <QDebug>
#include <QUdpSocket>
#include <QtNetwork>
#include <QString>
#include <QImage>
#include <QTime>
#include <QMessageBox>
#include <QBuffer>
#include <QFileDialog>
#include <QPainter>
//监控
namespace Ui {
class Monitor;
}

class Monitor : public QWidget
{
    Q_OBJECT

public:
    explicit Monitor(QWidget *parent = 0);
    ~Monitor();
protected:
    void paintEvent(QPaintEvent*);
private:
    Ui::Monitor *ui;
    QTimer* tim; // 声明 'tim' 变量的类型
    //Udp服务器
    QUdpSocket *udpSocket;
    //通信的ip和端口，用于获取发送者的 IP 和端口
    QHostAddress address;
    quint16 port;
    QImage currentPic; // 假设 'current' 是用于存储当前图像的 QPixmap 变量
    QByteArray currentDatagram;
    QPixmap fitpixmap;
private slots:
    void Button_PictureSlot();
    void ButtonSaveSlot();
    void sendSlot();
    void udp_receive_data();
    void onTimeOut();
    void btnconncetSlot();
signals:
    void readyRead();
    void changeBackGround();


};

#endif // MONITOR_H
